package thimeeeee.View;
import java.awt.*;
import javax.swing.ImageIcon;
/**
 *
 * @author AidanPryde
 */
public abstract class ViewElementBase {
    Image image;
    //minden mező alapja a sima field képe lesz, erre rajzoljuk rá az elemeket
    Image field;

    public ViewElementBase(){
        ImageIcon icon = new ImageIcon("image/field.png");
        field = icon.getImage();
    }
    public void Paint(Graphics g){
        //az alap kirajzolása (field)
        g.drawImage(field, 0, 0, g.getClipBounds().width, g.getClipBounds().height, null);
        //az adott elem kirajzolása
        g.drawImage(image, 0, 0, g.getClipBounds().width, g.getClipBounds().height, null);
    }

    public Image GetImage(){
        return image;
    }

    public void SetImage(Image img)
    {
        this.image = img;
    }
    
    public void SetImage(String filename)
    {
        //A mappa elérésiútja ide van beleégetve
        ImageIcon icon = new ImageIcon("image/"+filename+".png");
        image = icon.getImage();
    }
}